<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>1.基本列表渲染</title>
        <!-- 引入Vue -->
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <!-- 
            v -for 指令:
            1用于展示列表数据
            2.语法:v-for ="(item,index) in xxxx" :kry ="yyyy"
         -->
        <!-- 准备好一个容器-->
        <div id="demo">
            <h2>人员列表(遍历数组)</h2>
            <ul>
                <li v-for="(item,index) in persons">
                    {{item.name}}-{{item.age}}-{{index}}
                </li>
            </ul>
        </div>
    </body>

    <script type="text/javascript">
        //阻止 vue 在启动时生成生产提示。
        Vue.config.productionTip = false
        new Vue ({
            el:'#demo',
            data:{
                persons:[
                    {id:'001',name:'张三',age:18},
					{id:'002',name:'李四',age:19},
					{id:'003',name:'王五',age:20},
                ]
            }

        })
    </script>
</html>